<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>上传文件限制</title>
	</head>
	<body>
		<span>教案:</span><input type="file" accept=".doc,.docx,.xls,.ppt,.pdf" onchange="if(this.accept.indexOf(this.value.substring(this.value.lastIndexOf('.')))==-1){alert('文件格式错误'); this.value=null;}" />
		<span>海报:</span><input type="file" accept=".jpg,.png,.bmp" onchange="if(this.accept.indexOf(this.value.substring(this.value.lastIndexOf('.')))==-1){alert('文件格式错误'); this.value=null;}" />
		<span>视频:</span><input type="file" accept=".mp4"  onchange="if(this.accept.indexOf(this.value.substring(this.value.lastIndexOf('.')))==-1){alert('文件格式错误'); this.value=null;}" />
		
	</body>
</html>
